package com.hf.work03;

/**
 * 按小时拿工资
 * @author Lenovo-Healer
 */
public class HourlyEmployee extends ColaEmployee{
    /**
     * 每小时的工资
     */
    private double hourSalary;
    /**
     * 每月工作小时数
     */
    private double hourNum;

    /**
     * @param month 月份
     * @return 工资
     */
    @Override
    public double getSalary(int month) {
        //工资
        double salaries;
        //过线时间
        double hour = 160;
        //判断工作时间是否大于160
        if (this.hourNum > hour){
            salaries = (this.hourNum - 160) * this.hourSalary * 1.5 + 160 * this.hourSalary;
        }else {
            salaries = this.hourNum * this.hourSalary;
        }
        //返回总工资
        return super.getSalary(month)+salaries;
    }


    /**
     * 无参构造方法
     */
    public HourlyEmployee() {
    }

    /**
     * 有参构造方法
     * @param empName 姓名
     * @param birthdayMonth 生日月份
     * @param hourSalary 每小时工资
     * @param hourNum 每月工资小时数
     */
    public HourlyEmployee(String empName, int birthdayMonth, double hourSalary, double hourNum) {
        super(empName, birthdayMonth);
        this.hourSalary = hourSalary;
        this.hourNum = hourNum;
    }

    public double getHourSalary() {
        return hourSalary;
    }

    public void setHourSalary(double hourSalary) {
        this.hourSalary = hourSalary;
    }

    public double getHourNum() {
        return hourNum;
    }

    public void setHourNum(double hourNum) {
        this.hourNum = hourNum;
    }
}
